<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;
use App\Model\UserWalletModel;



//后台模块表
class ShopTypeModel extends Model
{
    //定义一个表名
    protected $table = 'shop_type';
    //定义主键
    protected $primaryKey = 'id';
	protected $guarded = [];

    //权限
    public function listAll()
    {
        $list = $this->orderBy('id', 'desc')->get();
        return $list;
    }

    //商品类别
	static function doList(){
    	$type = [];
		$types = ShopTypeModel::where('level',0)->get();
		foreach($types as $k=>$v){
			$type[$k]['id'] = $v['tid'];
			$type[$k]['name'] = $v['name'];
		}
		return $type;
	}


}
